/**
 *
 */
package com.jycode.ishop.model.base;

import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 * 在BaseEntity中写Hibernate NamedQueries, 集中在此处为全部POJO classes写出必要的hql, 并通过在对应的DAO Impl中创建一个相应的findByNamedQuer调用来完成该查询的实现.
 * 对于com.jycode.commons.model中的预定义pojo class: SysUser, SysRole, 仍然可以在这里进行NamedQuery书写，其作用是覆盖SysUser/SysRole中预定义的NamedQuery的声明。
 *
 * @author "banlyst <banlyst@gmail.com>"
 *
 */
@SuppressWarnings("serial")
@NamedQueries( {
	@NamedQuery(name = "SysUser.findById", query = "select u from SysUser u where id=:id"),
	//@NamedQuery(name = "SysUser.findByName", query = "from SysUser u where u.email=?"),
	@NamedQuery(name = "SysUser.findByEmail", query = "from SysUser u where u.email=?"),
	@NamedQuery(name = "SysUser.findByNamePassword", query = "from SysUser u where u.email=? and u.password=?"),
	@NamedQuery(name = "SysUser.findAll", query = "select u from SysUser u"),
	@NamedQuery(name = "SysUser.delete_manual", query = "delete from SysUser where id=:id"),
	//@NamedQuery(name = "SysUser.listByName", query = "from SysUser u where u.email LIKE ?"),
	@NamedQuery(name = "SysUser.checkValid", query = "select count(*) from SysUser u where u.email=? and u.password=?"),
	@NamedQuery(name = "SysUser.login", query = "from SysUser u where u.email=? and u.password=?"),
	@NamedQuery(name = "SysRole.findByName", query = "from SysRole r where r.name=?"),
	@NamedQuery(name = "SysRole.findByParentRoleId", query = "from SysRole r where r.parentId=?")
})
public class BaseEntity implements java.io.Serializable {

}
